#!/bin/bash
cd "$1"
x="1600";

if [ "$#" = "2" ]; then
x="$2";
fi

y=1

for plik in `find /home/piotr/Pulpit/fot/ -name *.JPG`
do
convert $plik -geometry "$x"x"$x" -flatten -quality 75 /home/piotr/test/$y.JPG
let "y += 1"

done 
